﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Seagull.Model.Stat
{
    public class ChannelStatistics
    {
        public DateTime StartTime { get; set; }

        public Statistic[] Statistics { get; set; }

        public ChannelStatistics()
        {
            Statistics = new Statistic[0];
        }

        public ChannelStatistics(DateTime startTime, Statistic[] statistics)
        {
            StartTime = startTime;
            Statistics = statistics;
        }

        public DateTime EndTime
        {
            get { return StartTime.AddHours(Statistics.Length); }
        }

        public IEnumerable<TimeStatistic> HourValues
        {
            get { return Statistics.Select((p, i) => new TimeStatistic(StartTime.AddHours(i), p)); }
        }
    }
}
